import * as React from 'react'; import { Text, SwitchField } from '@aws-amplify/ui-react'; export const SwitchFieldOnChangeExample = () => { const [switchCount, setSwitchCount] = React.useState(0); const changeCount = () => { setSwitchCount(switchCount + 1); }; return ( <> Number of times the switch has changed {switchCount} ); };